]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
windowAttentionHandler: Handle XUrgencyHint as well
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 13 Jul 2018 17:16:14 +0000 (19:16 +0200)
committerJonas Ådahl <jadahl@gmail.com>
Wed, 14 Nov 2018 13:42:33 +0000 (13:42 +0000)
While it's not commonly used, it is easy enough to handle it the
same as the demands-attention hint, so do just that.

https://bugzilla.gnome.org/show_bug.cgi?id=643595

js/ui/windowAttentionHandler.js

index 524e47c0f51cd7475f6052e7258cf77bfd5d3dd8..a8c688ef38ff94cab0a663e8f181f9aec8f410bb 100644 (file)
@@ -13,6 +13,8 @@ var WindowAttentionHandler = new Lang.Class({
         this._tracker = Shell.WindowTracker.get_default();
         this._windowDemandsAttentionId = global.display.connect('window-demands-attention',
                                                                 this._onWindowDemandsAttention.bind(this));
+        this._windowMarkedUrgentId = global.display.connect('window-marked-urgent',
+                                                                this._onWindowDemandsAttention.bind(this));
     },
 
     _getTitleAndBanner(app, window) {
@@ -66,7 +68,9 @@ var Source = new Lang.Class({
 
         this.signalIDs = [];
         this.signalIDs.push(this._window.connect('notify::demands-attention',
-                                                 () => { this.destroy(); }));
+                                                 this._sync.bind(this));
+        this.signalIDs.push(this._window.connect('notify::urgent',
+                                                 this._sync.bind(this));
         this.signalIDs.push(this._window.connect('focus',
                                                  () => { this.destroy(); }));
         this.signalIDs.push(this._window.connect('unmanaged',
@@ -75,6 +79,12 @@ var Source = new Lang.Class({
         this.connect('destroy', this._onDestroy.bind(this));
     },
 
+    _sync() {
+        if (this._window.demands_attention || this._window.urgent)
+            return;
+        this.destroy();
+    },
+
     _onDestroy() {
         for(let i = 0; i < this.signalIDs.length; i++) {
            this._window.disconnect(this.signalIDs[i]);